home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!willen.demon.co.uk
- From: Adrian Parker <adrian@willen.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: big endian, little endian
- Date: Mon, 15 Apr 96 23:04:03 GMT
- Organization: Quondam Ltd
- Message-ID: <829609443snz@willen.demon.co.uk>
- References: <4ku9dm$t1t@news.ycc.yale.edu>
- Reply-To: adrian@willen.demon.co.uk
- X-NNTP-Posting-Host: willen.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.30
- X-Mail2News-Path: willen.demon.co.uk
-
- In article <4ku9dm$t1t@news.ycc.yale.edu>
- rmurphy@minerva.cis.yale.edu "rmurphy" writes:
-
- > Hi. I'm a graduate student doing research in computer music, and i
- > have a small tech question I can't seem to get answered in the c
- > reference books. What is the difference between big-endian and
- > little-endian? I know it relates somehow to signed/unsigned integers,
- > and the division between ibm & 68k-based platforms, but have no clue
- > beyond that. Thanks.
- > rmurphy@minerva.cis.yale.edu
-
- I don't know if this is the only answer, but..
-
- It is to do with the way numbers are stored on different platforms.. if
- you write a c program that uses an integer, there is no guarantee that
- it will take up the same amount of storage on the two machines.. e.g.
- if you do a sizeof(int), you could get different answers.. this means
- that if you take an integer value created on one machine and send it to
- the other one, it may well be meaningless as far as the other program
- is concerned because it isn't in the right format for what it thinks of
- as an integer.
-
- when I've been doing network programming to send numbers about, I've
- usually done it by converting numbers to strings, and converting them
- back at the other end.. then the platform is unimportant.
-
- --
- :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
- :: Adrian Parker adrian@willen.demon.co.uk Quondam Ltd ::
- :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
-